<template>
    <div class="app-container">
      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
        <el-form-item label="操作类型" prop="jilutype">
        <el-input
          v-model="queryParams.jilutype"
          placeholder="请输入操作类型"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-form>
      <el-table v-loading="loading" :data="jiluList" @selection-change="handleSelectionChange">
        <el-table type="selection" width="55" align="center" />
        <el-table-column label="ID" align="center" prop="jiluid" />
        <el-table-column label="药品名称" align="center" prop="jiluname" />
           <el-table-column label="药品批号" align="center" prop="jilupihao" />
        <el-table-column label="操作时间" align="center" prop="jilutime" width="180">
          <template slot-scope="scope">
            <span>{{ parseTime(scope.row.jilutime, '{y}-{m}-{d}') }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作类型" align="center" prop="jilutype" />
        <el-table-column label="经办人" align="center" prop="jilupeople" />
        <el-table-column label="数量" align="center" prop="jilunumber" />
     
      </el-table>
      
      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
  
    </div>
  </template>
  
  <script>
  import { listJilu} from "@/api/warehouse/jilu";
  
  export default {
    name: "Jilu",
    data() {
      return {
        // 遮罩层
        loading: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        // 操作记录表格数据
        jiluList: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          jilutype: null,
        },
        // 表单参数
        form: {},
      };
    },
    created() {
      this.getList();
    },
    methods: {
      /** 查询操作记录列表 */
      getList() {
        this.loading = true;
        listJilu(this.queryParams).then(response => {
          this.jiluList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.reset();
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.resetForm("queryForm");
        this.handleQuery();
      },
    }
  };
  </script>
  